function clearForm() {
	var formObj =document.forms[0];
	var formEl = formObj.elements;
	 for (var i=0; i<formEl.length; i++){ 
		 var element = formEl[i];
		 var c_name=element.className;
		 if(c_name.length>0&&c_name=='Wdate'){
			 element.value = '';
		 }
			 
		 if (element.readOnly || element.readOnly =="readonly" || element.readOnly == true) { continue; } 
	        if (element.type == 'submit') { continue; }  
	        if (element.type == 'reset') { continue; }  
	        if (element.type == 'button') { continue; }  
	        if (element.type == 'hidden') { continue; }  
	                          
	        if (element.type == 'text') { element.value = ''; }  
	        if (element.type == 'textarea') { element.value = ''; }  
	        if (element.type == 'checkbox') { element.checked = false; }  
	        if (element.type == 'radio') { element.checked = false; }  
	        if (element.type == 'select-multiple') { element.selectedIndex = -1; }  
	        if (element.type == 'select-one') { element.selectedIndex = -1; }  
	}
}


function pad(num, n) {
    var len = num.toString().length;
    while(len < n) {
        num = '0' + num;
        len++;
    }
    return num;
}

function checkdate(start,end){   
	 //得到日期值并转化成日期格式，replace(/\-/g, "\/")是根据验证表达式把日期转化成长日期格式，这样
	 //再进行判断就好判断了
		var sDate = new Date(start.value.replace(/\-/g, "\/"));
	    var eDate = new Date(end.value.replace(/\-/g, "\/"));
	    if(sDate > eDate){
	    	alert("结束日期不能小于开始日期");
	    	end.value="";
	    	end.focus();
	    	return false;
	    }
	    return true;
	 }